--- title: "L1-007 念数字" created: 2025-11-28 tags: - 算法 --- # L1-007 念数字 ## 题目 [L1-007 念数字](https://pintia.cn/problem-sets/994805046380707840/exam/problems/type/7?problemSetProblemId=994805136889593856&page=0) ![[image-0b8fa421.png]] ## 思路分析 ## 代码实现 ```cpp #include using namespace std; #define endl '\n' int main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); string s; cin>>s; string ans; for(char c:s){ switch(c){ case '-': ans+="fu ";break; case '0': ans+="ling "; break; case '1': ans+="yi "; break; case '2': ans+="er "; break; case '3': ans+="san "; break; case '4': ans+="si "; break; case '5': ans+="wu "; break; case '6': ans+="liu "; break; case '7': ans+="qi "; break; case '8': ans+="ba "; break; case '9': ans+="jiu "; break; defult: break; } } ans.pop_back(); cout<